import sympy

x = sympy.Symbol('x')
a = 0
b = 2
c = 1
f = x

integral_ac = sympy.integrate(f, (x, a, c))
integral_cb = sympy.integrate(f, (x, c, b))
integral_ab = sympy.integrate(f, (x, a, b))

print(f"∫_[{a},{c}] {f} dx = {integral_ac}")
print(f"∫_[{c},{b}] {f} dx = {integral_cb}")
print(f"∫_[{a},{b}] {f} dx = {integral_ab}")
print(f"验证：{integral_ac} + {integral_cb} = {integral_ac + integral_cb}")